package com.vishnu.main;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;

import com.vishnu.pojo.Employee;

public class UsingJPA {
public static void main(String[] args) {
EntityManagerFactory emf=Persistence.createEntityManagerFactory("mysqlpu");
EntityManager em=emf.createEntityManager();
EntityTransaction et=em.getTransaction();

Employee employee=new Employee();
employee.setEmployeeId(3);
employee.setEmployeeName("raju..");
employee.setEmployeeSalary(3344.);
em.persist(employee);

et.commit();
em.close();
emf.close();
}
}
